<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@include file="/jsp/common/base.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>刷新简历</title>
<script type="text/javascript" src="${path}/js/jquery-1.4.2.js"></script>
<script type="text/javascript">
	//function startRefresh(){
	//	$("#startButton")
	//}
	$(document).ready(function () { 
		$("#startButton").click(function (){
			startButton();
			$("#statusSpan").html("系统运行中...");
			
			$.get('${path}/refreshresume.jhtml',{},function(result){
				/**
	            if(result==1){
					$("#statusSpan").html("系统运行中...");
	            }else{
	            	endButton();
	            	alert("出错啦");
	            }*/
	        });
	        
		});

		$("#endButton").click(function (){
			endButton();
			$.get('${path}/stoprefresh.jhtml',{},function(result){
	            if(result==1){
					$("#statusSpan").html("系统不在运行状态");
	            }else{
	            	startButton();
	            	alert("出错啦");
	            }
	        });
		});

		$("#loading").hide();

/**
		$("#loading").bind("ajaxSend", function(){
			   $(this).show();
			 }).bind("ajaxComplete", function(){
			   $(this).hide();
				}).bind("ajaxError", function(){
					alert("出错啦");
				});
		*/
	});

	function startButton(){
		$("#startButton").attr("disabled", true); 
		$("#endButton").attr("disabled", false); 
	}
	
	function endButton(){
		$("#startButton").attr("disabled", false); 
		$("#endButton").attr("disabled", true); 
	}

	
</script>
</head>

<body>
<div style="text-align: center;">
	<span id="statusSpan">${status? '系统运行中...' : '系统不在运行状态'}</span> 
	<div>
		<input type="button" id="startButton"  value="开始" ${status? 'disabled' : ''}/> 
		<input type="button" id="endButton"  value="结束" ${status? '' : 'disabled'}/>
	</div>
	<span id="loading">数据发送中...</span> 
</div>
</body>
</html>